#ifndef COLLAPSIBLEWIDGET_H
#define COLLAPSIBLEWIDGET_H

#include <QtGui>
#include "gui/separatorwidget.h"


/*
  Provides a header and a button with which to toggle the visibility
  of a QWidget. This is currently used for the reports windows.
 */
class CollapsibleWidget : public QWidget
{
    Q_OBJECT
public:
    explicit CollapsibleWidget(QWidget *parent = 0);

    QString getText();
    void setText(QString text);

    QWidget *getWidget();
    void setWidget(QWidget *widget);

signals:

public slots:
    void toggleWidget();

private:
    void initUiComponents();

    QVBoxLayout *mainLayout;
    QHBoxLayout *topLayout;

    QLabel *headerLabel;
    SeparatorWidget *separator;
    QPushButton *collapseButton;

    QWidget *expandWidget;
};

#endif // COLLAPSIBLEWIDGET_H
